<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./vue.js"></script>
    <style>
      .imgs img {
        width: 80px;
        border: 2px solid white;
      }
      .imgs .active {
        border-color: purple;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <img :src="imgs[i]" alt="" />
      <div class="imgs">
        <img
          v-for="(url,index) in imgs"
          :src="url"
          @click="i=index"
          :class="{active:index==i}"
          alt=""
        />
      </div>
    </div>
  </body>
  <script>
    let app = Vue.createApp({
      data() {
        return {
          imgs: [
            "http://bfs.biyao.com/group2/M00/25/41/CghiFmUjncKAWi9iABjB-wFJJss625_800x800.jpg",
            "http://bfs.biyao.com/group2/M00/74/48/CghiFmL-5teACsFIAB8d5X_83SI816_800x800.jpg",
            "http://bfs.biyao.com/group2/M00/74/29/CghkFmL-5tqADMn7AB81pETgGgg629_800x800.jpg",
            "http://bfs.biyao.com/group2/M00/74/48/CghiFmL-5t2AXXncABit7bGMJQw778_800x800.jpg",
            "http://bfs.biyao.com/group2/M00/74/48/CghiFmL-5uCAZJ2eAByUosANuLQ523_800x800.jpg",
          ],
          i: 0,
        };
      },
    });
    app = app.mount("#app");
  </script>
</html>
